<template>
	<view class="practice-container">
		<!-- 顶部按钮 -->
		<view class="header">
			<view class="menu-icon">☰</view>
			<view class="more-icon">⋯</view>
		</view>
		
		<!-- 开始练习按钮 -->
		<view class="start-section">
			<view class="start-button" @tap="startPractice">
				<text class="start-icon">▶</text>
				<text class="start-text">开始练习</text>
			</view>
		</view>
		
		<!-- 更多区域 -->
		<view class="more-section">
			<text class="section-title">更多</text>
			<view class="category-tabs">
				<text class="tab-item active">舞蹈教程</text>
				<text class="tab-item">考试题</text>
				<text class="tab-item">基本功</text>
				<text class="tab-item">自由练习</text>
			</view>
			
			<!-- 练习项目网格 -->
			<view class="practice-grid">
				<view class="practice-item" @tap="goToCourse">
					<view class="practice-image">
						<image :src="practiceImageSrc" mode="aspectFill"></image>
					</view>
					<view class="practice-info">
						<text class="practice-title">Cookie by 龙</text>
						<text class="practice-subtitle">基础动作讲解</text>
					</view>
				</view>
				
				<view class="practice-item" @tap="goToCourse">
					<view class="practice-image">
						<image :src="practiceImageSrc" mode="aspectFill"></image>
					</view>
					<view class="practice-info">
						<text class="practice-title">Model name</text>
						<text class="practice-subtitle">Location</text>
					</view>
				</view>
				
				<view class="practice-item" @tap="goToCourse">
					<view class="practice-image">
						<image :src="practiceImageSrc" mode="aspectFill"></image>
					</view>
					<view class="practice-info">
						<text class="practice-title">Model name</text>
						<text class="practice-subtitle">Location</text>
					</view>
				</view>
				
				<view class="practice-item" @tap="goToCourse">
					<view class="practice-image">
						<image :src="practiceImageSrc" mode="aspectFill"></image>
					</view>
					<view class="practice-info">
						<text class="practice-title">Model name</text>
						<text class="practice-subtitle">Location</text>
					</view>
				</view>
				
				<view class="practice-item large" @tap="goToCourse">
					<view class="practice-image">
						<image :src="practiceImageSrc" mode="aspectFill"></image>
					</view>
					<view class="practice-info">
						<text class="practice-title">瑜伽练习</text>
						<text class="practice-subtitle">放松训练</text>
					</view>
				</view>
			</view>
		</view>
		
		<!-- 底部导航栏 -->
		<view class="bottom-nav">
			<view class="nav-item" @tap="goToHome">
				<text class="nav-icon">🏠</text>
				<text class="nav-text">首页</text>
			</view>
			<view class="nav-item active">
				<text class="nav-icon">🎯</text>
				<text class="nav-text">练习</text>
			</view>
			<view class="nav-item" @tap="goToProfile">
				<text class="nav-icon">👤</text>
				<text class="nav-text">个人</text>
			</view>
		</view>
	</view>
</template>

<script>
import images from '../../utils/images.js'

export default {
	name: 'Practice',
	data() {
		return {
			// 页面数据
			practiceImageSrc: images.bgLogo // 使用统一的图片管理
		}
	},
	methods: {
		startPractice() {
			uni.navigateTo({
				url: '/pages/course/course'
			});
		},
		goToHome() {
			uni.navigateBack();
		},
		goToProfile() {
			uni.navigateTo({
				url: '/pages/profile/profile'
			});
		},
		goToCourse() {
			uni.navigateTo({
				url: '/pages/course/course'
			});
		}
	}
}
</script>

<style scoped>
.practice-container {
	background: linear-gradient(135deg, #FFE4E6 0%, #FFF0F2 100%);
	min-height: 100vh;
	padding: 0 30rpx 160rpx;
}

.header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 80rpx 0 40rpx;
}

.menu-icon, .more-icon {
	font-size: 40rpx;
	color: #333333;
	width: 60rpx;
	height: 60rpx;
	display: flex;
	align-items: center;
	justify-content: center;
}

.start-section {
	margin-bottom: 60rpx;
	display: flex;
	justify-content: center;
}

.start-button {
	background: #FFFFFF;
	border-radius: 60rpx;
	padding: 30rpx 80rpx;
	display: flex;
	align-items: center;
	box-shadow: 0 8rpx 30rpx rgba(255, 107, 157, 0.2);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.start-button:active {
	transform: scale(0.95);
	box-shadow: 0 4rpx 20rpx rgba(255, 107, 157, 0.3);
}

.start-icon {
	font-size: 32rpx;
	color: #FF6B9D;
	margin-right: 20rpx;
}

.start-text {
	font-size: 32rpx;
	font-weight: bold;
	color: #333333;
}

.more-section {
	flex: 1;
}

.section-title {
	font-size: 40rpx;
	font-weight: bold;
	color: #333333;
	margin-bottom: 30rpx;
	display: block;
}

.category-tabs {
	display: flex;
	margin-bottom: 40rpx;
}

.tab-item {
	font-size: 28rpx;
	color: #999999;
	margin-right: 40rpx;
	padding-bottom: 10rpx;
}

.tab-item.active {
	color: #333333;
	font-weight: bold;
	border-bottom: 4rpx solid #FF6B9D;
}

.practice-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 20rpx;
}

.practice-item {
	width: 330rpx;
	background: #FFFFFF;
	border-radius: 20rpx;
	overflow: hidden;
	box-shadow: 0 4rpx 20rpx rgba(255, 107, 157, 0.1);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.practice-item:active {
	transform: scale(0.98);
	box-shadow: 0 2rpx 10rpx rgba(255, 107, 157, 0.2);
}

.practice-item.large {
	width: 100%;
	height: 300rpx;
	display: flex;
}

.practice-image {
	width: 100%;
	height: 220rpx;
	background: linear-gradient(45deg, #FF6B9D, #FFB6C1);
	position: relative;
}

.practice-item.large .practice-image {
	width: 50%;
	height: 100%;
}

.practice-image image {
	width: 100%;
	height: 100%;
}

.practice-info {
	padding: 20rpx;
}

.practice-item.large .practice-info {
	width: 50%;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.practice-title {
	font-size: 28rpx;
	font-weight: bold;
	color: #333333;
	margin-bottom: 8rpx;
	display: block;
}

.practice-subtitle {
	font-size: 24rpx;
	color: #999999;
	display: block;
}

.bottom-nav {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	background: #FFFFFF;
	display: flex;
	padding: 20rpx 0;
	box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.1);
}

.nav-item {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 10rpx 0;
}

.nav-item.active .nav-icon,
.nav-item.active .nav-text {
	color: #FF6B9D;
}

.nav-icon {
	font-size: 44rpx;
	margin-bottom: 8rpx;
	color: #999999;
}

.nav-text {
	font-size: 22rpx;
	color: #999999;
}
</style> 